package cn.xuexiyuan.kpi.mapper;

import cn.xuexiyuan.kpi.entity.BillboardEntity;
import cn.xuexiyuan.kpi.entity.PageParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @Description:
 * @Author 左龙龙
 * @Date 20-11-27
 * @Version 1.0
 **/
@Repository
public interface BillboardMapper {

    @Insert({ "insert into tb_billboard(title, context) values(#{title}, #{context})"})
    void insert(BillboardEntity billboard);

    @Delete("delete from tb_billboard where id = #{id}")
    int delete(BillboardEntity billboard);

    @Select("select * from tb_billboard order by create_time desc limit 1")
    BillboardEntity findLatestOne();

    List<BillboardEntity> find(PageParam<BillboardEntity> param);

    int count(PageParam<BillboardEntity> param);

}
